package CreationalPatterns.Prototype.improved;


public class Sheep implements Cloneable{


  private int age;
  private String name;
  private String color;
  public Sheep friend;

  public Sheep(int age, String name, String color) {
    this.age = age;
    this.name = name;
    this.color = color;
  }

  public int getAge() {
    return age;
  }

  public void setAge(int age) {
    this.age = age;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getColor() {
    return color;
  }

  public void setColor(String color) {
    this.color = color;
  }

  @Override
  protected Object clone() {

    Sheep sheep = null;
    try{
      sheep = (Sheep) super.clone();
    }catch (Exception e){
      e.printStackTrace();
    }
    return sheep;
  }

  @Override
  public String toString() {
    return "Sheep{" +
            "age=" + age +
            ", name='" + name + '\'' +
            ", color='" + color + '\'' +
            '}';
  }
}
